
setTimeout(function(){
	//$("#businessName").val('');
	//$("#businessName").focus();
	$("#businessName").rules("add",{
		remote: {
			url: 'qz/business/checkName'+($("#businessName").val()+""),
			type: "get",
			dataType: "json", 
			dataFilter:function(data,type){
				return data=="false"?false:true;
			}
		}, 
		
		messages: {remote: "该业务名称已添加"}
		
	});  
} , parseInt(Math.random() * 1000)); 


var app = angular.module('businessApp', []);



app.controller('businessController', function($scope, $http) {
	$scope.business;
	
	$scope.refreshData=function(){
		$scope.business={};
	}
	
	$scope.businessSave=function(){
	   if($("#myForm").valid()){
		   $http.post('qz/business/add/', $scope.business).success(function(){
			   redirectUrl("manage/business/","list.jsp");
           });
	   }
	}
	
	$scope.businessReset=function(){
		$scope.business={};
	}
	
	$scope.businessCancle=function(){
		redirectUrl("manage/business/","list.jsp");
	}
});